<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>7.2.5 Static Resources 2.2.1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
    <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
    <script type="text/javascript">
function addJsClass() {
    var classes = document.body.className.split(" ");
    classes.push("js");
    document.body.className = classes.join(" ");
}
    </script>
</head>

<body class="body" onload="addJsClass();">
<div id="navigation">
    <ul>
        <li>
            <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
                <a href="../../guide/index.html" class="button">Table of contents</a>

                <div id="nav-summary-childs" style="display:none;">
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/gettingStarted.html"><strong>2</strong><span>Getting Started</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/upgradingFromPreviousVersionsOfGrails.html"><strong>3</strong><span>Upgrading from previous versions of Grails</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/conf.html"><strong>4</strong><span>Configuration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/commandLine.html"><strong>5</strong><span>The Command Line</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/GORM.html"><strong>6</strong><span>Object Relational Mapping (GORM)</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/theWebLayer.html"><strong>7</strong><span>The Web Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/validation.html"><strong>8</strong><span>Validation</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/services.html"><strong>9</strong><span>The Service Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/testing.html"><strong>10</strong><span>Testing</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/i18n.html"><strong>11</strong><span>Internationalization</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/security.html"><strong>12</strong><span>Security</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/plugins.html"><strong>13</strong><span>Plugins</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/webServices.html"><strong>14</strong><span>Web Services</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/spring.html"><strong>15</strong><span>Grails and Spring</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/hibernate.html"><strong>16</strong><span>Grails and Hibernate</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/scaffolding.html"><strong>17</strong><span>Scaffolding</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/deployment.html"><strong>18</strong><span>Deployment</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/contributing.html"><strong>19</strong><span>Contributing to Grails</span></a>
                    </div>
                    
                </div>
            </div>
        </li>
        <li class="separator selected">
            <a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
        </li>
    </ul>
</div>
<div id="header">
    <div class="images clearfix">
        
        <span id="logo"><a href="http://grails.org" target="_blank"><img alt="Grails Logo" title="The Grails Framework" src="../../img/grails.png" border="0"/></a></span>
        
        
        <span id="sponsor"><a href="http://springsource.com" target="_blank"><img alt="SpringSource Logo" title="SpringSource - Weapons for the War on Java Complexity" src="../../img/springsource-logo.png" border="0"/></a></span>
        
    </div>
    <p>See the light - agile, industrial strength, rapid web application development made easy</p>
</div>


<table id="colset" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td id="col1">
            <div id="main" class="corner-all">

                
                    <div class="toc-item prev-left"><a href="../../guide/GORM.html">&lt;&lt; <strong>6</strong><span>Object Relational Mapping (GORM)</span></a></div>
                

                <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>

                
                    <div class="toc-item next-right"><a href="../../guide/validation.html"><strong>8</strong><span>Validation</span> >></a></div>
                


                <div class="project">
                    <h1>7.2.5 Static Resources - Reference Documentation</h1>

                    <p><strong>Authors:</strong> Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith</p>

                    <p><strong>Version:</strong> 2.2.1</p>

                    
                </div>

                
                <div id="table-of-content">
                    <h2>Table of Contents</h2>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#includingResourcesUsingTheResourceTags"><strong>7.1</strong><span>Including resources using the resource tags</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#otherResourceTags"><strong>7.2</strong><span>Other resource tags</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#declaringResources"><strong>7.3</strong><span>Declaring resources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#overridingPluginResources"><strong>7.4</strong><span>Overriding plugin resources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#optimizingYourResources"><strong>7.5</strong><span>Optimizing your resources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#debugging"><strong>7.6</strong><span>Debugging</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#preventingProcessingOfResources"><strong>7.7</strong><span>Preventing processing of resources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#otherResourcesPlugins"><strong>7.8</strong><span>Other Resources-aware plugins</span></a>
                    </div>
                    
                </div>
                

                
<a name="6.2.5 Static Resources"><!-- Legacy link --></a>
<h2 id="resources">7.2.5 Static Resources</h2>
Grails 2.0 integrates with the <a href="http://grails.org/plugin/resources" target="blank">Resources plugin</a> to provide sophisticated static resource management. This plugin is installed by default in new Grails applications.<p class="paragraph"/>The basic way to include a link to a static resource in your application is to use the <a href="../ref/Tags/resource.html" class="tags">resource</a> tag. This simple approach creates a URI pointing to the file.<p class="paragraph"/>However modern applications with dependencies on multiple JavaScript and CSS libraries and frameworks (as well as dependencies on multiple Grails plugins) require something more powerful.<p class="paragraph"/>The issues that the Resources framework tackles are:
<ul class="star">
<li>Web application performance tuning is difficult</li>
<li>Correct ordering of resources, and deferred inclusion of JavaScript</li>
<li>Resources that depend on others that must be loaded first</li>
<li>The need for a standard way to expose static resources in plugins and applications</li>
<li>The need for an extensible processing chain to optimize resources</li>
<li>Preventing multiple inclusion of the same resource</li>
</ul><p class="paragraph"/>The plugin achieves this by introducing new artefacts and processing the resources using the server's local file system.<p class="paragraph"/>It adds artefacts for declaring resources, for declaring "mappers" that can process resources, and a servlet filter to serve processed resources.<p class="paragraph"/>What you get is an incredibly advanced resource system that enables you to easily create highly optimized web applications that run the same in development and in production.<p class="paragraph"/>The Resources plugin documentation provides a more detailed overview of the <a href="http://grails-plugins.github.com/grails-resources/" target="blank">concepts</a> which will be beneficial when reading the following guide.


<a name="6.2.5.1 Including resources using the resource tags"><!-- Legacy link --></a>
<h2 id="includingResourcesUsingTheResourceTags">7.2.5.1 Including resources using the resource tags</h2>
<h4>Pulling in resources with r:require</h4><p class="paragraph"/>To use resources, your GSP page must indicate which resource modules it requires. For example with the <a href="http://grails.org/plugin/jquery" target="blank">jQuery plugin</a>, which exposes a "jquery" resource module, to use jQuery in any page on your site you simply add:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;r:require module=<span class="xml&#45;quote">"jquery"</span>/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      &#8230;
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>This will automatically include all resources needed for jQuery, including them at the correct locations in the page. By default the plugin sets the disposition to be "head", so they load early in the page.<p class="paragraph"/>You can call <code>r:require</code> multiple times in a GSP page, and you use the "modules" attribute to provide a list of modules:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;r:require modules=<span class="xml&#45;quote">"jquery, main, blueprint, charting"</span>/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      &#8230;
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>The above may result in many JavaScript and CSS files being included, in the correct order, with some JavaScript files loading at the end of the body to improve the apparent page load time.<p class="paragraph"/>However you cannot use r:require in isolation - as per the examples you must have the &#60;r:layoutResources/&#62; tag to actually perform the render.<p class="paragraph"/><h4>Rendering the links to resources with r:layoutResources</h4><p class="paragraph"/>When you have declared the resource modules that your GSP page requires, the framework needs to render the links to those resources at the correct time.<p class="paragraph"/>To achieve this correctly, you must include the r:layoutResources tag twice in your page, or more commonly, in your GSP layout:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;g:layoutTitle/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      <span class="xml&#45;tag">&#60;g:layoutBody/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>This represents the simplest Sitemesh layout you can have that supports Resources.<p class="paragraph"/>The Resources framework has the concept of a "disposition" for every resource. This is an indication of where in the page the resource should be included.<p class="paragraph"/>The default disposition applied depends on the type of resource. All CSS must be rendered in &#60;head&#62; in HTML, so "head" is the default for all CSS, and will be rendered by the first r:layoutResources. Page load times are improved when JavaScript is loaded after the page content, so the default for JavaScript files is "defer", which means it is rendered when the second r:layoutResources is invoked.<p class="paragraph"/>Note that both your GSP page and your Sitemesh layout (as well as any GSP template fragments) can call r:require to depend on resources. The only limitation is that you must call r:require before the r:layoutResources that should render it.<p class="paragraph"/><h4>Adding page-specific JavaScript code with r:script</h4><p class="paragraph"/>Grails has the <a href="../ref/Tags/javascript.html" class="tags">javascript</a> tag which is adapted to defer to Resources plugin if installed, but it is recommended that you call <code>r:script</code> directly when you need to include fragments of JavaScript code.<p class="paragraph"/>This lets you write some "inline" JavaScript which is actually <strong class="bold">not</strong> rendered inline, but either in the &#60;head&#62; or at the end of the body, based on the disposition.<p class="paragraph"/>Given a Sitemesh layout like this:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;g:layoutTitle/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      <span class="xml&#45;tag">&#60;g:layoutBody/&#62;</span>
      <span class="xml&#45;tag">&#60;r:layoutResources/&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>...in your GSP you can inject some JavaScript code into the head or deferred regions of the page like this:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;title&#62;</span>Testing r:script magic!<span class="xml&#45;tag">&#60;/title&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      <span class="xml&#45;tag">&#60;r:script disposition=<span class="xml&#45;quote">"head"</span>&#62;</span>
         window.alert('This is at the end of <span class="xml&#45;tag">&#60;head&#62;</span>');
      <span class="xml&#45;tag">&#60;/r:script&#62;</span>
      <span class="xml&#45;tag">&#60;r:script disposition=<span class="xml&#45;quote">"defer"</span>&#62;</span>
         window.alert('This is at the end of the body, and the page has loaded.');
      <span class="xml&#45;tag">&#60;/r:script&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>The default disposition is "defer", so the disposition in the latter r:script is purely included for demonstration.<p class="paragraph"/>Note that such r:script code fragments <strong class="bold">always</strong> load after any modules that you have used, to ensure that any required libraries have loaded.<p class="paragraph"/><h4>Linking to images with r:img</h4><p class="paragraph"/>This tag is used to render <code>&#60;img&#62;</code> markup, using the Resources framework to process the resource on the fly (if configured to do so - e.g. make it eternally cacheable).<p class="paragraph"/>This includes any extra attributes on the <code>&#60;img&#62;</code> tag if the resource has been previously declared in a module.<p class="paragraph"/>With this mechanism you can specify the width, height and any other attributes in the resource declaration in the module, and they will be pulled in as necessary.<p class="paragraph"/>Example:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;html&#62;</span>
   <span class="xml&#45;tag">&#60;head&#62;</span>
      <span class="xml&#45;tag">&#60;title&#62;</span>Testing r:img<span class="xml&#45;tag">&#60;/title&#62;</span>
   <span class="xml&#45;tag">&#60;/head&#62;</span>
   <span class="xml&#45;tag">&#60;body&#62;</span>
      <span class="xml&#45;tag">&#60;r:img uri=<span class="xml&#45;quote">"/images/logo.png"</span>/&#62;</span>
   <span class="xml&#45;tag">&#60;/body&#62;</span>
<span class="xml&#45;tag">&#60;/html&#62;</span></pre></div><p class="paragraph"/>Note that Grails has a built-in <code>g:img</code> tag as a shortcut for rendering <code>&#60;img&#62;</code> tags that refer to a static resource. The Grails <a href="../ref/Tags/img.html" class="tags">img</a> tag is Resources-aware and will delegate to <code>r:img</code> if found. However it is recommended that you use <code>r:img</code> directly if using the Resources plugin.<p class="paragraph"/>Alongside the regular Grails <a href="../ref/Tags/resource.html" class="tags">resource</a> tag attributes, this also supports the "uri" attribute for increased brevity.<p class="paragraph"/>See <a href="http://grails-plugins.github.com/grails-resources" target="blank">r:resource documentation</a> for full details.


<a name="6.2.5.2 Other resource tags"><!-- Legacy link --></a>
<h2 id="otherResourceTags">7.2.5.2 Other resource tags</h2>
<h4>r:resource</h4><p class="paragraph"/>This is equivalent to the Grails <a href="../ref/Tags/resource.html" class="Tags">resource</a> tag, returning a link to the processed static resource. Grails' own <code>g:resource</code> tag delegates to this implementation if found, but if your code requires the Resources plugin, you should use <code>r:resource</code> directly.<p class="paragraph"/>Alongside the regular Grails <a href="../ref/Tags/resource.html" class="Tags">resource</a> tag attributes, this also supports the "uri" attribute for increased brevity.<p class="paragraph"/>See <a href="http://grails-plugins.github.com/grails-resources" target="blank">r:resource documentation</a> for full details.<p class="paragraph"/><h4>r:external</h4><p class="paragraph"/>This is a resource-aware version of Grails <a href="../ref/Tags/external.html" class="Tags">external</a> tag which renders the HTML markup necessary to include an external file resource such as CSS, JS or a favicon.<p class="paragraph"/>See <a href="http://grails-plugins.github.com/grails-resources" target="blank">r:resource documentation</a> for full details.


<a name="6.2.5.3 Declaring resources"><!-- Legacy link --></a>
<h2 id="declaringResources">7.2.5.3 Declaring resources</h2>
A DSL is provided for declaring resources and modules. This can go either in your <code>Config.groovy</code> in the case of application-specific resources, or more commonly in a resources artefact in <code>grails-app/conf</code>.<p class="paragraph"/>Note that you do not need to declare all your static resources, especially images. However you must to establish dependencies or other resources-specific attributes. Any resource that is not declared is called "ad-hoc" and will still be processed using defaults for that resource type.<p class="paragraph"/>Consider this example resource configuration file, <code>grails-app/conf/MyAppResources.groovy</code>:<p class="paragraph"/><div class="code"><pre>modules = &#123;
    core &#123;
        dependsOn 'jquery, utils'<p class="paragraph"/>        resource url: '/js/core.js', disposition: 'head'
        resource url: '/js/ui.js'
        resource url: '/css/main.css',
        resource url: '/css/branding.css'
        resource url: '/css/print.css', attrs: &#91;media: 'print'&#93;
    &#125;<p class="paragraph"/>    utils &#123;
        dependsOn 'jquery'<p class="paragraph"/>        resource url: '/js/utils.js'
    &#125;<p class="paragraph"/>    forms &#123;
        dependsOn 'core,utils'<p class="paragraph"/>        resource url: '/css/forms.css'
        resource url: '/js/forms.js'
    &#125;
&#125;</pre></div><p class="paragraph"/>This defines three resource modules; 'core', 'utils' and 'forms'. The resources in these modules will be automatically bundled out of the box according to the module name, resulting in fewer files. You can override this with <code>bundle:'someOtherName'</code> on each resource, or call <code>defaultBundle</code> on the module (see <a href="http://grails-plugins.github.com/grails-resources" target="blank">resources plugin documentation</a>).<p class="paragraph"/>It declares dependencies between them using <code>dependsOn</code>, which controls the load order of the resources.<p class="paragraph"/>When you include an <code>&#60;r:require module="forms"/&#62;</code> in your GSP, it will pull in all the resources from 'core' and 'utils' as well as 'jquery', all in the correct order.<p class="paragraph"/>You'll also notice the <code>disposition:'head'</code> on the <code>core.js</code> file. This tells Resources that while it can defer all the other JS files to the end of the body, this one must go into the <code>&#60;head&#62;</code>.<p class="paragraph"/>The CSS file for print styling adds custom attributes using the <code>attrs</code> map option, and these are passed through to the <code>r:external</code> tag when the engine renders the link to the resource, so you can customize the HTML attributes of the generated link.<p class="paragraph"/>There is no limit to the number of modules or xxxResources.groovy artefacts you can provide, and plugins can supply them to expose modules to applications, which is exactly how the jQuery plugin works.<p class="paragraph"/>To define modules like this in your application's Config.groovy, you simply assign the DSL closure to the <code>grails.resources.modules</code> Config variable.<p class="paragraph"/>For full details of the resource DSL please see the <a href="http://grails-plugins.github.com/grails-resources" target="blank">resources plugin documentation</a>.


<a name="6.2.5.4 Overriding plugin resources"><!-- Legacy link --></a>
<h2 id="overridingPluginResources">7.2.5.4 Overriding plugin resources</h2>
Because a resource module can define the bundle groupings and other attributes of resources, you may find that the settings provided are not correct for your application.<p class="paragraph"/>For example, you may wish to bundle jQuery and some other libraries all together in one file. There is a load-time and caching trade-off here, but often it is the case that you'd like to override some of these settings.<p class="paragraph"/>To do this, the DSL supports an "overrides" clause, within which you can change the <code>defaultBundle</code> setting for a module, or attributes of individual resources that have been declared with a unique id:<p class="paragraph"/><div class="code"><pre>modules = &#123;
    core &#123;
        dependsOn 'jquery, utils'
        defaultBundle 'monolith'<p class="paragraph"/>        resource url: '/js/core.js', disposition: 'head'
        resource url: '/js/ui.js'
        resource url: '/css/main.css',
        resource url: '/css/branding.css'
        resource url: '/css/print.css', attrs: &#91;media: 'print'&#93;
    &#125;<p class="paragraph"/>    utils &#123;
        dependsOn 'jquery'
        defaultBundle 'monolith'<p class="paragraph"/>        resource url: '/js/utils.js'
    &#125;<p class="paragraph"/>    forms &#123;
        dependsOn 'core,utils'
        defaultBundle 'monolith'<p class="paragraph"/>        resource url: '/css/forms.css'
        resource url: '/js/forms.js'
    &#125;<p class="paragraph"/>    overrides &#123;
        jquery &#123;
            defaultBundle 'monolith'
        &#125;
    &#125;
&#125;</pre></div><p class="paragraph"/>This will put all code into a single bundle named 'monolith'. Note that this can still result in multiple files, as separate bundles are required for head and defer dispositions, and JavaScript and CSS files are bundled separately.<p class="paragraph"/>Note that overriding individual resources requires the original declaration to have included a unique id for the resource.<p class="paragraph"/>For full details of the resource DSL please see the <a href="http://grails-plugins.github.com/grails-resources" target="blank">resources plugin documentation</a>.


<a name="6.2.5.5 Optimizing your resources"><!-- Legacy link --></a>
<h2 id="optimizingYourResources">7.2.5.5 Optimizing your resources</h2>
The Resources framework uses "mappers" to mutate the resources into the final format served to the user.<p class="paragraph"/>The resource mappers are applied to each static resource once, in a specific order. You can create your own resource mappers, and several plugins provide some already for zipping, caching and minifying.<p class="paragraph"/>Out of the box, the Resources plugin provides bundling of resources into fewer files, which is achieved with a few mappers that also perform CSS re-writing to handle when your CSS files are moved into a bundle.<p class="paragraph"/><h4>Bundling multiple resources into fewer files</h4><p class="paragraph"/>The 'bundle' mapper operates by default on any resource with a "bundle" defined - or inherited from a <code>defaultBundle</code> clause on the module. Modules have an implicit default bundle name the same as the name of the module.<p class="paragraph"/>Files of the same kind will be aggregated into this bundle file. Bundles operate across module boundaries:<p class="paragraph"/><div class="code"><pre>modules = &#123;
    core &#123;
        dependsOn 'jquery, utils'
        defaultBundle 'common'<p class="paragraph"/>        resource url: '/js/core.js', disposition: 'head'
        resource url: '/js/ui.js', bundle: 'ui'
        resource url: '/css/main.css', bundle: 'theme'
        resource url: '/css/branding.css'
        resource url: '/css/print.css', attrs: &#91;media: 'print'&#93;
    &#125;<p class="paragraph"/>    utils &#123;
        dependsOn 'jquery'<p class="paragraph"/>        resource url: '/js/utils.js', bundle: 'common'
    &#125;<p class="paragraph"/>    forms &#123;
        dependsOn 'core,utils'<p class="paragraph"/>        resource url: '/css/forms.css', bundle: 'ui'
        resource url: '/js/forms.js', bundle: 'ui'
    &#125;
&#125;</pre></div><p class="paragraph"/>Here you see that resources are grouped into bundles; 'common', 'ui' and 'theme' - across module boundaries.<p class="paragraph"/>Note that auto-bundling by module does <strong class="bold">not</strong> occur if there is only one resource in the module.<p class="paragraph"/><h4>Making resources cache "eternally" in the client browser</h4><p class="paragraph"/>Caching resources "eternally" in the client is only viable if the resource has a unique name that changes whenever the contents change, and requires caching headers to be set on the response.<p class="paragraph"/>The <a href="http://grails.org/plugin/cached-resources" target="blank">cached-resources</a> plugin provides a mapper that achieves this by hashing your files and renaming them based on this hash. It also sets the caching headers on every response for those resources. To use, simply install the cached-resources plugin.<p class="paragraph"/>Note that the caching headers can only be set if your resources are being served by your application. If you have another server serving the static content from your app (e.g. Apache HTTPD), configure it to send caching headers. Alternatively you can configure it to request and proxy the resources from your container.<p class="paragraph"/><h4>Zipping resources</h4><p class="paragraph"/>Returning gzipped resources is another way to reduce page load times and reduce bandwidth.<p class="paragraph"/>The <a href="http://grails.org/plugin/zipped-resources" target="blank">zipped-resources</a> plugin provides a mapper that automatically compresses your content, excluding by default already compressed formats such as gif, jpeg and png.<p class="paragraph"/>Simply install the zipped-resources plugin and it works.<p class="paragraph"/><h4>Minifying</h4><p class="paragraph"/>There are a number of CSS and JavaScript minifiers available to obfuscate and reduce the size of your code. At the time of writing none are publicly released but releases are imminent.


<a name="6.2.5.6 Debugging"><!-- Legacy link --></a>
<h2 id="debugging">7.2.5.6 Debugging</h2>
When your resources are being moved around, renamed and otherwise mutated, it can be hard to debug client-side issues. Modern browsers, especially Safari, Chrome and Firefox have excellent tools that let you view all the resources requested by a page, including the headers and other information about them.<p class="paragraph"/>There are several debugging features built in to the Resources framework.<p class="paragraph"/><h4>X-Grails-Resources-Original-Src Header</h4><p class="paragraph"/>Every resource served in development mode will have the X-Grails-Resources-Original-Src: header added, indicating the original source file(s) that make up the response.<p class="paragraph"/><h4>Adding the debug flag</h4><p class="paragraph"/>If you add a query parameter <strong class="bold">_debugResources=y</strong> to your URL and request the page, Resources will bypass any processing so that you can see your original source files.<p class="paragraph"/>This also adds a unique timestamp to all your resource URLs, to defeat any caching that browsers may use. This means that you should always see your very latest code when you reload the page.<p class="paragraph"/><h4>Turning on debug all the time</h4><p class="paragraph"/>You can turn on the aforementioned debug mechanism without requiring a query parameter, but turning it on in Config.groovy:<p class="paragraph"/><div class="code"><pre>grails.resources.debug = <span class="java&#45;keyword">true</span></pre></div><p class="paragraph"/>You can of course set this per-environment.


<a name="6.2.5.7 Preventing processing of resources"><!-- Legacy link --></a>
<h2 id="preventingProcessingOfResources">7.2.5.7 Preventing processing of resources</h2>
Sometimes you do not want a resource to be processed in a particular way, or even at all. Occasionally you may also want to disable all resource mapping.<p class="paragraph"/><h4>Preventing the application of a specific mapper to an individual resource</h4><p class="paragraph"/>All resource declarations support a convention of noXXXX:true where XXXX is a mapper name.<p class="paragraph"/>So for example to prevent the "hashandcache" mapper from being applied to a resource (which renames and moves it, potentially breaking relative links written in JavaScript code), you would do this:<p class="paragraph"/><div class="code"><pre>modules = &#123;
    forms &#123;
        resource url: '/css/forms.css', nohashandcache: <span class="java&#45;keyword">true</span>
        resource url: '/js/forms.js', nohashandcache: <span class="java&#45;keyword">true</span>
    &#125;
&#125;</pre></div><p class="paragraph"/><h4>Excluding/including paths and file types from specific mappers</h4><p class="paragraph"/>Mappers have includes/excludes Ant patterns to control whether they apply to a given resource. Mappers set sensible defaults for these based on their activity, for example the zipped-resources plugin's "zip" mapper is set to exclude images by default.<p class="paragraph"/>You can configure this in your <code>Config.groovy</code> using the mapper name e.g:<p class="paragraph"/><div class="code"><pre>// We wouldn't link to .exe files using Resources but <span class="java&#45;keyword">for</span> the sake of example:
grails.resources.zip.excludes = &#91;'&#42;&#42;/&#42;.zip', '&#42;&#42;/&#42;.exe'&#93;<p class="paragraph"/>// Perhaps <span class="java&#45;keyword">for</span> some reason we want to prevent bundling on <span class="java&#45;quote">"less"</span> CSS files:
grails.resources.bundle.excludes = &#91;'&#42;&#42;/&#42;.less'&#93;</pre></div><p class="paragraph"/>There is also an "includes" inverse. Note that settings these replaces the default includes/excludes for that mapper - it is not additive.<p class="paragraph"/><h4>Controlling what is treated as an "ad-hoc" (legacy) resource</h4><p class="paragraph"/>Ad-hoc resources are those undeclared, but linked to directly in your application <strong class="bold">without</strong> using the Grails or Resources linking tags (resource, img or external).<p class="paragraph"/>These may occur with some legacy plugins or code with hardcoded paths in.<p class="paragraph"/>There is a Config.groovy setting <strong class="bold">grails.resources.adhoc.patterns</strong> which defines a list of Servlet API compliant filter URI mappings, which the Resources filter will use to detect such "ad-hoc resource" requests.<p class="paragraph"/>By default this is set to:
<div class="code"><pre>grails.resources.adhoc.patterns = &#91;'images/&#42;', '&#42;.js', '&#42;.css'&#93;</pre></div>


<a name="6.2.5.8 Other Resources-aware plugins"><!-- Legacy link --></a>
<h2 id="otherResourcesPlugins">7.2.5.8 Other Resources-aware plugins</h2>
At the time of writing, the following plugins include support for the Resources framework:
<ul class="star">
<li><a href="http://grails.org/plugin/jquery" target="blank">jquery</a></li>
<li><a href="http://grails.org/plugin/jquery-ui" target="blank">jquery-ui</a></li>
<li><a href="http://grails.org/plugin/blueprint" target="blank">blueprint</a></li>
<li><a href="http://grails.org/plugin/lesscss-resources" target="blank">lesscss-resources</a></li>
<li><a href="http://grails.org/plugin/zipped-resources" target="blank">zipped-resources</a></li>
<li><a href="http://grails.org/plugin/cached-resources" target="blank">cached-resources</a></li>
</ul><p class="paragraph"/>


                <div style="clear:both;margin-top:15px;"></div>
                
                    <div class="toc-item prev-left"><a href="../../guide/GORM.html">&lt;&lt; <strong>6</strong><span>Object Relational Mapping (GORM)</span></a></div>
                
                    <div class="toc-item next-right"><a href="../../guide/validation.html"><strong>8</strong><span>Validation</span> >></a></div>
                
                <div style="clear:both"></div>
            </div>
        </td>
        <td id="col2">
            <div class="local clearfix">
                <div class="local-title">
                    <a href="../../guide/index.html" target="mainFrame">Quick Reference</a>
                    <span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
                </div>
                <div class="menu">
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Command Line</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Command%20Line/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/add-proxy.html">add-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/alias.html">alias</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/bootstrap.html">bootstrap</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/bug-report.html">bug-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/clean.html">clean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/clear-proxy.html">clear-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/compile.html">compile</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/console.html">console</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-app.html">create-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-controller.html">create-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-domain-class.html">create-domain-class</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-filters.html">create-filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-hibernate-cfg-xml.html">create-hibernate-cfg-xml</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-integration-test.html">create-integration-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-multi-project-build.html">create-multi-project-build</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-plugin.html">create-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-pom.html">create-pom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-scaffold-controller.html">create-scaffold-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-script.html">create-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-service.html">create-service</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-tag-lib.html">create-tag-lib</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-unit-test.html">create-unit-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/dependency-report.html">dependency-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/doc.html">doc</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-all.html">generate-all</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-controller.html">generate-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-views.html">generate-views</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/help.html">help</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/init.html">init</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-dependency.html">install-dependency</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-plugin.html">install-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-templates.html">install-templates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/integrate-with.html">integrate-with</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/interactive.html">interactive</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/list-plugin-updates.html">list-plugin-updates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/list-plugins.html">list-plugins</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/migrate-docs.html">migrate-docs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/package-plugin.html">package-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/package.html">package</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/plugin-info.html">plugin-info</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/refresh-dependencies.html">refresh-dependencies</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/remove-proxy.html">remove-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-app.html">run-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-script.html">run-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-war.html">run-war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/schema-export.html">schema-export</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/set-proxy.html">set-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/set-version.html">set-version</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/shell.html">shell</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/stats.html">stats</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/stop-app.html">stop-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/test-app.html">test-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/uninstall-plugin.html">uninstall-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/upgrade.html">upgrade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/war.html">war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/wrapper.html">wrapper</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Constraints</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Constraints/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Constraints/attributes.html">attributes</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/bindable.html">bindable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/blank.html">blank</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/creditCard.html">creditCard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/email.html">email</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/inList.html">inList</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/matches.html">matches</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/max.html">max</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/maxSize.html">maxSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/min.html">min</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/minSize.html">minSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/notEqual.html">notEqual</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/nullable.html">nullable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/range.html">range</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/scale.html">scale</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/size.html">size</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/unique.html">unique</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/url.html">url</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/validator.html">validator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/widget.html">widget</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Controllers</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Controllers/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Controllers/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/afterInterceptor.html">afterInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/allowedMethods.html">allowedMethods</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/beforeInterceptor.html">beforeInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/bindData.html">bindData</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/chain.html">chain</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/defaultAction.html">defaultAction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/forward.html">forward</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/grailsApplication.html">grailsApplication</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/redirect.html">redirect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/session.html">session</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/withForm.html">withForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/withFormat.html">withFormat</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Database Mapping</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/autoImport.html">autoImport</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/autoTimestamp.html">autoTimestamp</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/batchSize.html">batchSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/cache.html">cache</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/cascade.html">cascade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/column.html">column</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/comment.html">comment</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/discriminator.html">discriminator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/dynamicInsert.html">dynamicInsert</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/dynamicUpdate.html">dynamicUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/fetch.html">fetch</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/id.html">id</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/ignoreNotFound.html">ignoreNotFound</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/indexColumn.html">indexColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/insertable.html">insertable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/joinTable.html">joinTable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/lazy.html">lazy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/order.html">order</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/sort.html">sort</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/table.html">table</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/type.html">type</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/updateable.html">updateable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/version.html">version</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Domain Classes</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/addTo.html">addTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/attach.html">attach</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/belongsTo.html">belongsTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/clearErrors.html">clearErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/constraints.html">constraints</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/count.html">count</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/countBy.html">countBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/createCriteria.html">createCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/delete.html">delete</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/discard.html">discard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/embedded.html">embedded</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/errors.html">errors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/executeQuery.html">executeQuery</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/executeUpdate.html">executeUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/exists.html">exists</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/fetchMode.html">fetchMode</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/find.html">find</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAllBy.html">findAllBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAllWhere.html">findAllWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findBy.html">findBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrCreateBy.html">findOrCreateBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrCreateWhere.html">findOrCreateWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrSaveBy.html">findOrSaveBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrSaveWhere.html">findOrSaveWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findWhere.html">findWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/first.html">first</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/get.html">get</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getAll.html">getAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getDirtyPropertyNames.html">getDirtyPropertyNames</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getPersistentValue.html">getPersistentValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasMany.html">hasMany</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasOne.html">hasOne</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/ident.html">ident</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/instanceOf.html">instanceOf</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/isAttached.html">isAttached</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/isDirty.html">isDirty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/last.html">last</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/list.html">list</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/listOrderBy.html">listOrderBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/load.html">load</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/lock.html">lock</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/mappedBy.html">mappedBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/mapping.html">mapping</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/merge.html">merge</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/namedQueries.html">namedQueries</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/properties.html">properties</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/read.html">read</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/refresh.html">refresh</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/removeFrom.html">removeFrom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/save.html">save</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/transients.html">transients</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/validate.html">validate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/where.html">where</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/whereAny.html">whereAny</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withCriteria.html">withCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withNewSession.html">withNewSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withSession.html">withSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withTransaction.html">withTransaction</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Plug-ins</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Plug-ins/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/URL%20mappings.html">URL mappings</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/codecs.html">codecs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/controllers.html">controllers</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/core.html">core</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/dataSource.html">dataSource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/domainClasses.html">domainClasses</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/filters.html">filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/hibernate.html">hibernate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/i18n.html">i18n</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/logging.html">logging</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/scaffolding.html">scaffolding</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/services.html">services</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/servlets.html">servlets</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/web%20flow.html">web flow</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Services</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Services/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Services/scope.html">scope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Services/transactional.html">transactional</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Servlet API</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tag Libraries</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/pageScope.html">pageScope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tags</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../../ref/Tags/actionSubmit.html">actionSubmit</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/actionSubmitImage.html">actionSubmitImage</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/applyLayout.html">applyLayout</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/checkBox.html">checkBox</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/collect.html">collect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/cookie.html">cookie</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/country.html">country</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/countrySelect.html">countrySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/createLink.html">createLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/createLinkTo.html">createLinkTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/currencySelect.html">currencySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/datePicker.html">datePicker</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/each.html">each</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/eachError.html">eachError</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/else.html">else</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/elseif.html">elseif</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/external.html">external</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/field.html">field</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/fieldValue.html">fieldValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/form.html">form</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formRemote.html">formRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatBoolean.html">formatBoolean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatDate.html">formatDate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatNumber.html">formatNumber</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/grep.html">grep</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/header.html">header</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/hiddenField.html">hiddenField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/if.html">if</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/img.html">img</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/include.html">include</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/isAvailable.html">isAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/isNotAvailable.html">isNotAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/javascript.html">javascript</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/join.html">join</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutBody.html">layoutBody</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutHead.html">layoutHead</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutTitle.html">layoutTitle</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/link.html">link</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/localeSelect.html">localeSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/message.html">message</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/meta.html">meta</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/pageProperty.html">pageProperty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/paginate.html">paginate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/passwordField.html">passwordField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/radio.html">radio</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/radioGroup.html">radioGroup</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteField.html">remoteField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteFunction.html">remoteFunction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteLink.html">remoteLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/renderErrors.html">renderErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/resource.html">resource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/select.html">select</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/set.html">set</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/setProvider.html">setProvider</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/sortableColumn.html">sortableColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/submitButton.html">submitButton</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/submitToRemote.html">submitToRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/textArea.html">textArea</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/textField.html">textField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/timeZoneSelect.html">timeZoneSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/unless.html">unless</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/uploadForm.html">uploadForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/while.html">while</a>
                            </div>
                            
                            </div>
                    </div>
                    
                </div>
            </div>
        </td>
    </tr>
</table>

<div id="footer">
    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
    Sponsored by <a href="http://springsource.com">SpringSource</a>
</div>

<script type="text/javascript" src="../js/docs.js"></script>

</body>
</html>
